package com.gzhryc.system.dao.db;

import java.io.Serializable;
import java.util.Date;

import com.gzhryc.common.data.ITree;
import com.gzhryc.jdbc.annotaion.Column;
import com.gzhryc.jdbc.annotaion.Id;
import com.gzhryc.jdbc.annotaion.Table;
import com.gzhryc.system.dao.enums.MenuEnum;

/**
 * 菜单
 * @author 张浩
 * @version 2016-9-1
 */
@Table(name="sys_menu")
public class Menu implements ITree<Long>,Serializable{

	private static final long serialVersionUID = 1L;
	
	@Id
	protected Long id;
	//基础属性
	@Column
	protected String name;
	
	@Column
	protected String icon;
	
	@Column(length=255)
	protected String link;
	
	@Column(length=4)
	protected Integer type;		 //菜单类型，1-路径权限，2-功能权限
	
	@Column(length=255)
	protected String permission; //权限标识，多个权限以逗号分隔
	
	@Column(length=4)
	protected Integer priority;
	
	@Column(name="is_leaf")
	protected Boolean isLeaf;
	
	@Column(name="parent_id")
	protected Long parentId;
	
	@Column(name="update_date",autoUpdateTime=true)
	protected Date updateDate;
	
	@Column(name="create_date")
	protected Date createDate;
	
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getLink() {
		return link;
	}
	public void setLink(String link) {
		this.link = link;
	}
	public Integer getPriority() {
		return priority;
	}
	public void setPriority(Integer priority) {
		this.priority = priority;
	}
	public Long getParentId() {
		return parentId;
	}
	public void setParentId(Long parentId) {
		this.parentId = parentId;
	}
	public String getIcon() {
		return icon;
	}
	public void setIcon(String icon) {
		this.icon = icon;
	}
	public Integer getType() {
		return type;
	}
	public void setType(Integer type) {
		this.type = type;
	}
	public String getPermission() {
		return permission;
	}
	public void setPermission(String permission) {
		this.permission = permission;
	}
	public Date getUpdateDate() {
		return updateDate;
	}
	public void setUpdateDate(Date updateDate) {
		this.updateDate = updateDate;
	}
	public Date getCreateDate() {
		return createDate;
	}
	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}
	public Boolean getIsLeaf() {
		return isLeaf;
	}
	public void setIsLeaf(Boolean isLeaf) {
		this.isLeaf = isLeaf;
	}
	
	public String getTypeName() {
		return MenuEnum.Type.note(this.type);
	}
}
